<template>
	<div id="policy">

		<!--       ...........     保单审核弹出框        ...............                            -->
		<el-dialog title="保单审核" :visible.sync="dialogFormVisible2">
			<el-form :model="form">
				<el-form-item label="被保人:" :label-width="formLabelWidth">
					<el-input v-model="form.recognizeeName" autocomplete="off" disabled></el-input>
				</el-form-item>
				<el-col :span="12">
					<el-form-item label="投保人:" :label-width="formLabelWidth">
						<el-select v-model="form.policyholdersId" filterable @change="selectChange2" placeholder="请选择投保人">
							<el-option :key="pol.policyholdersId" v-for="pol in polist" :label="pol.policyholdersName" :value="pol.policyholdersId"></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="被保人:" style="margin-left: 10px;" :label-width="formLabelWidth">
						<el-select v-model="form.recognizeeId" placeholder="请选择被保人">
							<el-option :key="rec.recognizeeId" v-for="rec in relist" :label="rec.recognizeeName" :value="rec.recognizeeId"></el-option>

						</el-select>
					</el-form-item>
				</el-col>

				<el-col :span="12">
					<el-form-item label="发动机号:" :label-width="formLabelWidth">
						<el-input v-model="form.engineid" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="车架号:" :label-width="formLabelWidth">
						<el-input v-model="form.frameId" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="车身颜色:" :label-width="formLabelWidth">
						<el-input v-model="form.licenseId" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="使用性质:" :label-width="formLabelWidth">
						<el-input v-model="form.nature" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="出厂日期:" :label-width="formLabelWidth">
						<el-input v-model="form.mintedDate" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="核定载客数:" :label-width="formLabelWidth">
						<el-input v-model="form.customersSum" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="车辆行驶证号:" :label-width="formLabelWidth">
						<el-input v-model="form.sailNumber" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="车主姓名:" :label-width="formLabelWidth">
						<el-input v-model="form.carOwnerName" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="新车购置价:" :label-width="formLabelWidth">
						<el-input v-model="form.vpDollar" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="初次登记日期:" :label-width="formLabelWidth">
						<el-input v-model="form.registerDate" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="实际使用年限:" :label-width="formLabelWidth">
						<el-input v-model="form.placemanLength" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="已行驶里程:" :label-width="formLabelWidth">
						<el-input v-model="form.mileage" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="车牌号:" :label-width="formLabelWidth">
						<el-input v-model="form.plateNumber" autocomplete="off" disabled></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" class="col1">
					<el-col :span="12" class="col1">
						<el-form-item label="保单起期:" :label-width="formLabelWidth">
							<el-input v-model="form.insuranceBeginTime" autocomplete="off" disabled format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="12" class="col1">
						<el-form-item label="保单止期:" :label-width="formLabelWidth">
							<el-input v-model="form.insuranceEndTime" autocomplete="off" disabled format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd"></el-input>
						</el-form-item>
					</el-col>
				</el-col>

				<el-col :span="24">
					<el-form-item label="保单类型:" :label-width="formLabelWidth">
						<input type="radio" v-model="form.warrantyType" disabled name="type" value="1" />新保
						<input type="radio" v-model="form.warrantyType" disabled name="type" value="2" />续保
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="保单状态:" :label-width="formLabelWidth">
						<el-radio-group v-model="form.warrantyState">
							<el-radio :label="1">保险期内</el-radio>
							<el-radio :label="2">注销</el-radio>
							<el-radio :label="3">退保</el-radio>
						</el-radio-group>
					</el-form-item>
				</el-col>

			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible2 = false">取 消</el-button>
				<el-button type="primary" @click="shenhe()">确定</el-button>
			</div>
		</el-dialog>



		<!--                                 保单修改                                 -->
		<el-dialog title="保单修改" :visible.sync="dialogFormVisible3">
			<el-form :model="form">
				<el-col :span="24">
					<el-form-item label="被保人:" :label-width="formLabelWidth">
						<el-input v-model="form.recognizeeName" autocomplete="off"></el-input>
						<el-button type="primary" @click="dialogTableVisible5=true">查找被保人</el-button>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="发动机号:" :label-width="formLabelWidth">
						<el-input v-model="form.engineid" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="车架号:" :label-width="formLabelWidth">
						<el-input v-model="form.frameId" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="厂牌型号:" :label-width="formLabelWidth">
						<el-input v-model="form.makeId" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="车身颜色:" :label-width="formLabelWidth">
						<el-input v-model="form.licenseId" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="使用性质:" :label-width="formLabelWidth">
						<el-input v-model="form.nature" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="出厂日期:" :label-width="formLabelWidth">
						<el-date-picker type="date" placeholder="选择出厂日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd" v-model="form.mintedDate"></el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="车辆行驶证号:" :label-width="formLabelWidth">
						<el-input v-model="form.sailNumber" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="车主姓名:" :label-width="formLabelWidth">
						<el-input v-model="form.carOwnerName" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="车牌号:" :label-width="formLabelWidth">
						<el-input v-model="form.plateNumber" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>

				<el-col :span="12" class="col1">
					<el-form-item label="保单起期:" :label-width="formLabelWidth">
						<el-date-picker placeholder="选择保单起期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="form.insuranceBeginTime"></el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12" class="col1">
					<el-form-item label="保单止期:" :label-width="formLabelWidth">
						<el-date-picker placeholder="选择保单止期" @change="dateChange" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="form.insuranceEndTime"></el-date-picker>
					</el-form-item>
				</el-col>


				<el-col :span="24">
					<el-form-item label="保单类型:" :label-width="formLabelWidth">
						<input type="radio" v-model="form.warrantyType" name="type" value="1" />新保
						<input type="radio" v-model="form.warrantyType" name="type" value="2" />续保
					</el-form-item>
				</el-col>

			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible3 = false">取 消</el-button>
				<el-button type="primary" @click="xiugai()">确 定</el-button>
			</div>
		</el-dialog>

		<el-dialog title="被保人信息" :visible.sync="dialogTableVisible5" @row-click="handleCurrentChange3">
			<el-table :data="gridData">
				<el-table-column property="recognizeeId" label="被保人编号" type="" width="150"></el-table-column>
				<el-table-column property="recognizeeName" label="被保人" width="150"></el-table-column>
				<el-table-column property="policyholdersId" label="投保人编号" type="" width="150"></el-table-column>
				<el-table-column property="policyholdersName" label="投保人" width="150"></el-table-column>
			</el-table>
			<el-button type="primary" @click="xuanz()">确定</el-button>
		</el-dialog>


		<el-dialog title="添加保单" :visible.sync="dialogFormVisible1">
			<el-form :model="form">
				<!-- <el-col :span="12">
					<el-form-item label="投保人:" :label-width="formLabelWidth">
						<el-select v-model="form.policyholdersId" @change="selectChange2" placeholder="请选择投保人">
							<el-option :key="pol.policyholdersId" v-for="pol in polist" :label="pol.policyholdersName" :value="pol.policyholdersId"></el-option>

						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="被保人:" style="margin-left: 10px;" :label-width="formLabelWidth">
						<el-select v-model="form.recognizeeId" placeholder="请选择被保人">
							<el-option :key="rec.recognizeeId" v-for="rec in relist" :label="rec.recognizeeName" :value="rec.recognizeeId"></el-option>

						</el-select>
					</el-form-item>
				</el-col> -->
				<el-col :span="24">
					<el-form-item label="被保人:" :label-width="formLabelWidth">
						<el-input v-model="form.recognizeeName" autocomplete="off"></el-input>
						<el-button type="primary" @click="dialogTableVisible5=true">查找被保人</el-button>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="投保金额:" style="margin-left: 10px;" :label-width="formLabelWidth">
						<el-select v-model="form.insureMoney" @change="selectChange" placeholder="请选择被保人">
							<el-option label="1000" value="1000"></el-option>
							<el-option label="2000" value="2000"></el-option>
							<el-option label="3000" value="3000"></el-option>
							<el-option label="5000" value="5000"></el-option>
							<el-option label="10000" value="10000"></el-option>
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="发动机号:" :label-width="formLabelWidth">
						<el-input v-model="form.engineid" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="车架号:" :label-width="formLabelWidth">
						<el-input v-model="form.frameId" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="厂牌型号:" :label-width="formLabelWidth">
						<el-input v-model="form.makeId" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="车身颜色:" :label-width="formLabelWidth">
						<el-input v-model="form.licenseId" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="使用性质:" :label-width="formLabelWidth">
						<el-input v-model="form.nature" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="出厂日期:" :label-width="formLabelWidth">
						<el-date-picker type="date" placeholder="选择出厂日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd" v-model="form.mintedDate"></el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="核定载客数:" :label-width="formLabelWidth">
						<el-input v-model="form.customersSum" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="车辆行驶证号:" :label-width="formLabelWidth">
						<el-input v-model="form.sailNumber" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="车主姓名:" :label-width="formLabelWidth">
						<el-input v-model="form.carOwnerName" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="新车购置价:" :label-width="formLabelWidth">
						<el-input v-model="form.vpDollar" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="初次登记日期:" :label-width="formLabelWidth">
						<el-date-picker type="date" placeholder="选择初次登记日期" format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd" v-model="form.registerDate"></el-date-picker>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="实际使用年限:" :label-width="formLabelWidth">
						<el-input v-model="form.placemanLength" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="已行驶里程:" :label-width="formLabelWidth">
						<el-input v-model="form.mileage" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24">
					<el-form-item label="车牌号:" :label-width="formLabelWidth">
						<el-input v-model="form.plateNumber" autocomplete="off"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="24" class="col1">
					<el-form-item label="交强险时间:" label-width="150px" class="item1">
						<el-col :span="10">
							<el-date-picker type="date" placeholder="选择保单起期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="form.insuranceBeginTime"
							 style="width: 100%;"></el-date-picker>
						</el-col>
						<el-col class="line" :span="2">0时至</el-col>
						<el-col :span="10">
							<el-date-picker placeholder="选择保单止期" @change="dateChange" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="form.insuranceEndTime"
							 style="width: 100%;"></el-date-picker>
						</el-col>
						<el-col class="line" style="margin-right: 20px;" :span="2">0时结束</el-col>
						<input type="checkbox" @change="handleCheckedCitiesChange2" v-model="xb" value="1" />投保
					</el-form-item>

				</el-col>
				<el-col :span="24" class="col1">
					<el-form-item label="商业险时间:" label-width="150px" class="item1">
						<el-col :span="10">
							<el-date-picker type="date" placeholder="选择保单起期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="form.insuranceBeginTime"
							 style="width: 100%;"></el-date-picker>
						</el-col>
						<el-col class="line" :span="2">0时至</el-col>
						<el-col :span="10">
							<el-date-picker placeholder="选择保单止期" @change="dateChange" format="yyyy-MM-dd" value-format="yyyy-MM-dd" v-model="form.insuranceEndTime"
							 style="width: 100%;"></el-date-picker>
						</el-col>
						<el-col class="line" style="margin-right: 20px;" :span="2">0时结束</el-col>
						<input type="checkbox" @change="handleCheckedCitiesChange2" v-model="xb" value="2" />投保
					</el-form-item>

				</el-col>
				<el-col :span="24">
					<el-form-item label="保单类型:" :label-width="formLabelWidth">
						<el-radio-group v-model="form.warrantyType" @change="baotype" size="small">
							<el-radio label="1" value="1"  border>新保</el-radio>
							<el-radio label="2" value="2" border>续保</el-radio>
						</el-radio-group>
					</el-form-item>
					<p style="font-size: 16px;" v-if="flag3">该被保人的车辆出险记录次数为: <span style="font-size: 18px;color: red;">{{cxcount}}</span> </p>
				</el-col>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible1 = false">取 消</el-button>
				<el-button type="primary" @click="next()">下一步</el-button>
			</div>
		</el-dialog>




		<el-dialog title="保费信息" :visible.sync="dialogTableVisible">
			<div v-if="flag1">
				<h3>交强险</h3>
				<table border="1" style="width: 100%;line-height: 30px;">
					<tr style="background-color: aqua;">
						<td></td>
						<td>是否投保</td>
						<td>保险费(元)</td>
					</tr>
					<tr>
						<td>交强险</td>
						<td><input type="checkbox" @change="handleCheckedCitiesChange2" v-model="xb" value="1" /> </td>
						<td>{{jsform.jqx}}</td>
					</tr>
				</table>
			</div>
			<div v-if="flag2">
				<h3>商业险</h3>
				<table border="1" style="width: 100%;line-height: 30px;">
					<tr style="background-color: aqua;">
						<td>基本险</td>
						<td>投保金额/责任限额</td>
						<td>是否投保</td>
						<td>保险费(元)</td>
					</tr>
					<tr>
						<td>机动车损失险</td>
						<td>{{form.vpDollar}}</td>
						<td><input type="checkbox" @change="handleCheckedCitiesChange2" v-model="xb" value="3" /></td>
						<td>{{jsform.ssx}}</td>
					</tr>
					<tr>
						<td>第三者责任保险</td>
						<td>
							<el-select v-model="jsform.qianx" @change="jsform1">
								<el-option label="10" value="10"></el-option>
								<el-option label="20" value="20"></el-option>
								<el-option label="30" value="30"></el-option>
								<el-option label="50" value="50"></el-option>
								<el-option label="100" value="100"></el-option>
							</el-select>
							万
						</td>
						<td><input type="checkbox" @change="handleCheckedCitiesChange2" v-model="xb" value="4" /></td>
						<td>{{jsform.dsx}}</td>
					</tr>
					<tr>
						<td>车上人员责任险(司机)</td>
						<td>
							<el-select v-model="jsform.qianx2" @change="jsform2">
								<el-option label="5" value="5"></el-option>
								<el-option label="10" value="10"></el-option>
								<el-option label="15" value="15"></el-option>
								<el-option label="20" value="20"></el-option>
								<el-option label="30" value="30"></el-option>
								<el-option label="50" value="50"></el-option>
							</el-select>
							万
						</td>
						<td><input type="checkbox" @change="handleCheckedCitiesChange2" v-model="xb" value="5" /></td>
						<td>{{jsform.csdx}}</td>
					</tr>
					<tr>
						<td>车上人员责任险(乘客)</td>
						<td>
							<el-select v-model="jsform.qianx3" @change="jsform3">
								<el-option label="5" value="5"></el-option>
								<el-option label="10" value="10"></el-option>
								<el-option label="15" value="15"></el-option>
								<el-option label="20" value="20"></el-option>
								<el-option label="30" value="30"></el-option>
								<el-option label="50" value="50"></el-option>
							</el-select>
							万
						</td>
						<td><input type="checkbox" @change="handleCheckedCitiesChange2" v-model="xb" value="6" /></td>
						<td>{{jsform.csrx}}</td>
					</tr>
					<tr>
						<td>机动车盗抢险</td>
						<td>{{form.premiumMoney}}</td>
						<td><input type="checkbox" @change="handleCheckedCitiesChange2" v-model="xb" value="7" /></td>
						<td>{{jsform.dqx}}</td>
					</tr>
					<tr style="background-color: aqua;">
						<td>附加险</td>
						<td>投保金额/责任限额</td>
						<td>是否投保</td>
						<td>保险费(元)</td>
					</tr>
					<tr>
						<td>玻璃单独破碎险</td>
						<td>
							<el-select v-model="jsform.qian4" @change="jsform4">
								<el-option label="国产玻璃" value="国产玻璃"></el-option>
								<el-option label="进口玻璃" value="进口玻璃"></el-option>
							</el-select>
						</td>
						<td><input type="checkbox" @change="handleCheckedCitiesChange2" v-model="xb" value="8" /></td>
						<td>{{jsform.blx}}</td>
					</tr>
					<tr>
						<td>车身划痕损失险</td>
						<td>
							<el-select v-model="jsform.qian5" @change="jsform5">
								<el-option label="2000" value="2000"></el-option>
								<el-option label="5000" value="5000"></el-option>
								<el-option label="10000" value="10000"></el-option>
								<el-option label="20000" value="20000"></el-option>
							</el-select>
						</td>
						<td><input type="checkbox" @change="handleCheckedCitiesChange2" v-model="xb" value="9" /></td>
						<td>{{jsform.hhx}}</td>
					</tr>
					<tr>
						<td>自然损失险</td>
						<td>{{form.premiumMoney}}</td>
						<td><input type="checkbox" @change="handleCheckedCitiesChange2" v-model="xb" value="10" /></td>
						<td>{{jsform.zrx}}</td>
					</tr>
					<tr>
						<td>不计免赔案特约条款</td>
						<td colspan="2">
							<input type="checkbox" @change="handleCheckedCitiesChange" v-model="mmlist" value="车损" />车损
							<input type="checkbox" @change="handleCheckedCitiesChange" v-model="mmlist" value="三者" />三者
							<input type="checkbox" @change="handleCheckedCitiesChange" v-model="mmlist" value="司机" />司机
							<input type="checkbox" @change="handleCheckedCitiesChange" v-model="mmlist" value="乘客" />乘客
							<input type="checkbox" @change="handleCheckedCitiesChange" v-model="mmlist" value="盗抢" />盗抢
							<input type="checkbox" @change="handleCheckedCitiesChange" v-model="mmlist" value="划痕" />划痕
						</td>
						<td>{{jsform.mmx}}</td>
					</tr>
				</table>
			</div>

			<div slot="footer" class="dialog-footer">
				<el-button type="primary" @click="dialogFormVisible1 = true;dialogTableVisible=false;">上一步</el-button>
				<el-button type="primary" @click="next2()">下一步</el-button>
			</div>
		</el-dialog>

		<el-dialog title="保单信息" :visible.sync="dialogTableVisible2">

			<table border="1" style="width: 100%;line-height: 30px;">
				<tr style="text-align: center;">
					<td colspan="6">当前客户{{policyholdersName}}已投保成功</td>
				</tr>
				<tr style="background-color: aqua;">
					<td colspan="2">商业险保费(元)</td>
					<td colspan="2">交强险保费(元)</td>
					<td colspan="2">共计(元)</td>
				</tr>
				<tr>
					<td colspan="2">{{syje}}</td>
					<td colspan="2">{{jsform.jqx}}</td>
					<td colspan="2">{{sum}}</td>
				</tr>
				<tr style="background-color: aqua;text-align: left;">
					<td colspan="6">保单号如下：</td>
				</tr>
				<tr>
					<td colspan="2">保单号：</td>
					<td colspan="3">{{form.warrantyId}}</td>

				</tr>

			</table>
			<div slot="footer" class="dialog-footer">
				<el-button @click="addTotal()">关闭窗口</el-button>
			</div>
		</el-dialog>

		<el-dialog title="保费金额信息" :visible.sync="dialogTableVisible3">

			<table border="1" style="width: 100%;line-height: 30px;">
				<tr style="text-align: center;">
					<td colspan="6">被保人：<span style="font-size: 18px;font-weight: 800;">{{form.recognizeeName}}</span>
						车牌号：<span style="font-size: 18px;font-weight: 800;">{{form.plateNumber}}</span>
					</td>
				</tr>
				<tr style="background-color: aqua;">
					<td colspan="3">险别名称</td>
					<td colspan="3">是否投保</td>
				</tr>
				<tr>
					<td colspan="3">交强险</td>
					<td colspan="3"><input type="checkbox" disabled v-model="xb" value="1" /></td>
				</tr>
				<tr>
					<td colspan="3">机动车损失险</td>
					<td colspan="3"><input type="checkbox" disabled v-model="xb" value="3" /></td>
				</tr>
				<tr>
					<td colspan="3">第三者责任保险</td>
					<td colspan="3"><input type="checkbox" disabled v-model="xb" value="4" /></td>
				</tr>
				<tr>
					<td colspan="3">车上人员责任险(司机)</td>
					<td colspan="3"><input type="checkbox" disabled v-model="xb" value="5" /></td>
				</tr>
				<tr>
					<td colspan="3">车上人员责任险(乘客)</td>
					<td colspan="3"><input type="checkbox" disabled v-model="xb" value="6" /></td>
				</tr>
				<tr>
					<td colspan="3">机动车盗抢险</td>
					<td colspan="3"><input type="checkbox" disabled v-model="xb" value="7" /></td>
				</tr>
				<tr>
					<td colspan="3">玻璃单独破碎险</td>
					<td colspan="3"><input type="checkbox" disabled v-model="xb" value="8" /></td>
				</tr>
				<tr>
					<td colspan="3">车身划痕损失险</td>
					<td colspan="3"><input type="checkbox" disabled v-model="xb" value="9" /></td>
				</tr>
				<tr>
					<td colspan="3">自然损失险</td>
					<td colspan="3"><input type="checkbox" disabled v-model="xb" value="10" /></td>
				</tr>
				<tr>
					<td colspan="3">不计免赔案特约条款</td>
					<td colspan="3"><input type="checkbox" disabled v-model="xb" value="11" /></td>
				</tr>
				<tr>
					<td colspan="6">保险总额:<span style="color: red;font-size: 18px;">{{form.premiumTotal}}</span></td>
				</tr>
				<tr style="background-color: aqua;text-align: left;">
					<td colspan="6">保单号如下：</td>
				</tr>
				<tr>
					<td colspan="2">保单号：</td>
					<td colspan="3">{{form.warrantyId}}</td>
				</tr>
			</table>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogTableVisible3=false">关闭窗口</el-button>
			</div>
		</el-dialog>
		<el-container>
			<el-header>
				<el-row :gutter="20">
					<el-col :span="3">
						<div class="grid-content bg-purple">车险理赔系统</div>
					</el-col>
					<el-col :span="2" :offset="14">
						<div class=" bg-purple font1">欢迎您</div>
					</el-col>
					<el-col :span="2">
						<div class=" bg-purple font1">{{uname}}</div>
					</el-col>
					<el-col :span="2">
						<div class=" bg-purple font1"><a class="hover1" @click="exit">安全退出</a></div>
					</el-col>
				</el-row>
			</el-header>
			<el-main>
				<el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm form1">
					<el-form-item label="保单号">
						<el-input v-model="ruleForm.warrantyId"></el-input>
					</el-form-item>
					<el-form-item label="被保人">
						<el-input v-model="ruleForm.recognizeeName"></el-input>
					</el-form-item>
					<el-form-item label="车牌号">
						<el-input v-model="ruleForm.plateNumber"></el-input>
					</el-form-item>
					<el-form-item label="车架号">
						<el-input v-model="ruleForm.frameId"></el-input>
					</el-form-item>
					<el-form-item>
						<el-button type="primary" @click="submitForm('ruleForm')">查询</el-button>
						<el-button class="but" @click="resetForm('ruleForm')">重置</el-button>
					</el-form-item>
				</el-form>
				<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
					<el-tab-pane label="保单列表" name="first">
						<el-tooltip content="添加保单信息" placement="top">
							<el-button type="primary" icon="el-icon-plus" @click="openinsert()"></el-button>
						</el-tooltip>
						<el-tooltip content="修改保单信息" placement="top">
							<el-button class="button" type="primary" @click="openUpdate()" icon="el-icon-edit"></el-button>
						</el-tooltip>
						<el-tooltip content="删除保单信息" placement="top">
							<el-button class="button" type="primary" @click="del()" icon="el-icon-delete"></el-button>
						</el-tooltip>
						<el-tooltip content="保单审核" placement="top">
							<el-button class="button" type="primary" @click="openShenhe()" icon="el-icon-search"></el-button>
						</el-tooltip>
						<el-tooltip content="保费金额计算方式" placement="top">
							<el-button class="button" type="primary" @click="openbaof()" icon="el-icon-edit-outline"></el-button>
						</el-tooltip>
						<p>近一月将有过期的保单数为: <span style="color: red;font-size: 18px;">{{gqcount}} </span> </p>
						<el-table ref="singleTable" :data="tableData" highlight-current-row @row-click="handleCurrentChange" style="width: 100%;height:325px">
							<el-table-column property="warrantyId" label="保单号" width="130">
							</el-table-column>
							<el-table-column property="recognizeeName" label="被保人" width="100">
							</el-table-column>
							<el-table-column property="plateNumber" label="车牌号" width="100">
							</el-table-column>
							<el-table-column property="frameId" label="车架号" width="120">
							</el-table-column>
							<el-table-column property="makeId" label="厂牌型号" width="120">
							</el-table-column>
							<el-table-column property="insuranceBeginTime" label="起保时间" width="120">
							</el-table-column>
							<el-table-column property="insuranceEndTime" label="终保时间" width="120">
							</el-table-column>
							<el-table-column property="premiumTotal" label="保费总额" width="110">
							</el-table-column>
							<el-table-column property="indemnifyMax" label="赔偿限额" width="105">
							</el-table-column>
							<el-table-column label="保单类型" width="100">
								<td slot-scope="scope">{{zhDisposeType(scope.row.warrantyType)}}</td>
							</el-table-column>
							<el-table-column label="保单状态">
								<td slot-scope="scope">{{zhProspectState(scope.row.warrantyState)}}</td>
							</el-table-column>
						</el-table>
					</el-tab-pane>
				</el-tabs>
				<el-pagination background layout="prev, pager, next" :total="total" :page-size="pageSize" @current-change="handleCurrentChange2">
				</el-pagination>
			</el-main>
		</el-container>
	</div>
</template>

<script>
	export default {
		name: "policy",
		data() {
			return {
				uname: sessionStorage.getItem("userName"),
				ruleForm: {
					warrantyId: '',
					recognizeeName: '',
					plateNumber: '',
					frameId: ''
				},
				activeName: 'first',
				tableData: [],
				form: {
					//保单编号，例如 bd_2019010100001
					warrantyId: '',
					//投保人-外键
					policyholdersId: 0,
					//被保人-外键
					recognizeeId: 0,
					//签单日期
					permissionTime: '',
					//保险起期
					insuranceBeginTime: '',
					//保险止期
					insuranceEndTime: '',
					//缴费时间
					paymentTime: '',
					//保费总额
					premiumTotal: 0,
					//保单类型(1.新保 2.续保)
					warrantyType: 1,
					//保单状态(1.正常 2.注销 3.退保)
					warrantyState: 1,
					//投保金额
					insureMoney: 1000,
					//保险金额
					premiumMoney: 100000,
					//赔偿限额
					indemnifyMax: 100000,
					//发动机号
					engineid: '',
					//车架号
					frameId: '',
					//厂牌型号
					makeId: '',
					//车身颜色
					licenseId: '',
					//使用性质
					nature: '',
					//出厂日期
					mintedDate: '',
					//核定载客数
					customersSum: '',
					//车辆行驶证号
					sailNumber: '',
					//车主姓名
					carOwnerName: '',
					//新车购置价
					vpDollar: 0,
					//初次登记日期
					registerDate: '',
					//际使用年限
					placemanLength: 0,
					//已行驶里程
					mileage: 0,
					//车牌号
					plateNumber: '',
					//结案时间
					closeCaseTime: '',
					//案件状态
					caseState: 1,
					//被保人
					recognizeeName: ''
				},
				tableData1: [],
				dialogFormVisible1: false,
				dialogFormVisible2: false,
				formLabelWidth: '100px',
				dialogTableVisible: false,
				dialogTableVisible2: false,
				dialogFormVisible3: false,
				dialogTableVisible3: false,
				dialogTableVisible5: false,
				flag1: false,
				flag2: false,
				flag3:false,
				cxcount:0,
				total: 0,
				pageSize: 4,
				page: 1,
				tjflag: true,
				xb: [],
				jsform: {
					jqx: 0,
					ssx: 0,
					dsx: 0,
					csdx: 0,
					csrx: 0,
					dqx: 0,
					blx: 0,
					hhx: 0,
					zrx: 0,
					mmx: 0,
					qianx: 10,
					qianx2: 10,
					qianx3: 10,
					qian4: '国产玻璃',
					qian5: 2000
				},
				mmlist: [],
				syje: 0,
				sum: 0,
				polist: [],
				relist: [],
				pname: '',
				gridData: [],
				beibr: null,
				policyholdersName: '',
				gqcount:0

			}
		},
		methods: {
			tjcx: function() {
				this.$axios.get("warranty/getWarrantyId?warrantyId=" + this.ruleForm.warrantyId + "&recognizeeName=" + this.ruleForm
						.recognizeeName + "&plateNumber=" + this.ruleForm.plateNumber + "&frameId=" + this.ruleForm.frameId + "&page=" +
						this.page)
					.then(msg => {
						this.total = msg.data.total;
						this.tableData = msg.data.list;
					});
			},
			submitForm(formName) {
				this.tjcx();
				this.tjflag = false;
			},
			resetForm() {
				this.ruleForm = {
					warrantyId: '',
					recognizeeName: '',
					plateNumber: '',
					frameId: ''
				}
			},
			handleClick(tab, event) {
				console.log(tab, event);
			},
			handleCurrentChange(val) {
				this.currentRow = val;
			},
			handleCurrentChange2(val) {
				this.page = val;
				if (tjflag) {
					this.policyAll();
				} else {
					this.tjcx();
				}

			},
			dateChange(value) {
				var time1 = new Date(value).getTime();
				var time2 = new Date(this.form.insuranceBeginTime).getTime();
				if (time1 < time2) {
					this.$notify({
						title: '保单止期不能在起期之前',
						type: 'warning'
					});
					this.form.insuranceEndTime = '';
				}
			},
			handleCheckedCitiesChange2() {

			},
			selectChange(value) {
				if (value == 1000) {
					this.form.premiumMoney = 100000;
					this.form.indemnifyMax = 100000;
				} else if (value == 2000) {
					this.form.premiumMoney = 200000;
					this.form.indemnifyMax = 200000;
				} else if (value == 3000) {
					this.form.premiumMoney = 300000;
					this.form.indemnifyMax = 300000;
				} else if (value == 5000) {
					this.form.premiumMoney = 500000;
					this.form.indemnifyMax = 500000;
				} else if (value == 10000) {
					this.form.premiumMoney = 1000000;
					this.form.indemnifyMax = 1000000;
				}
			},
			handleCurrentChange3(val) {
				this.beibr = val;
			},
			baotype(value) {
				if(value==2){
					if(this.form.plateNumber!=''&&this.form.recognizeeId!=0){
						this.$axios.get("warranty/getWarrantyCount?recognizeeId=" + this.form.recognizeeId+"&plateNumber="+this.form.plateNumber)
							.then(msg => {
								if(msg.data==0){
									this.$notify({
										title: '此用户为首次购买保险',
										type: 'warning'
									});
									this.form.warrantyType=1;
								}else{
									this.$notify({
										title: '此用户已为该车牌号'+this.form.plateNumber+'购买车险次数'+msg.data+'次',
										type: 'warning'
									});
								}
							});
						this.$axios.get("case/getCaseCount?recognizeeId=" + this.form.recognizeeId+"&plateNumber="+this.form.plateNumber)
							.then(msg => {
								this.cxcount=msg.data;
								this.flag3=true;
								if(msg.data>=8){
									this.dialogFormVisible1 = false;
									this.$notify({
										title: '此用户已的车辆有8次及以上的出险记录次数，不能续保',
										type: 'warning'
									});
								}
							});	
					}
				}else{
					this.flag3=false;
				}
			},
			xuanz: function() {
				if (this.beibr != null) {
					this.form.policyholdersId = this.beibr.policyholdersId;
					this.form.recognizeeId = this.beibr.recognizeeId;
					this.form.recognizeeName = this.beibr.recognizeeName;
					this.policyholdersName = this.beibr.policyholdersName;
					this.dialogTableVisible5 = false;
				} else {
					this.$notify({
						title: '请选择需要被保人信息',
						type: 'warning'
					});
				}
			},
			pnames: function(name) {
				this.pname = name;
			},
			handleCheckedCitiesChange(value) {
				this.jsform.mmx = 0;
				this.mmlist.forEach((row, i) => {
					if (row == '车损') {
						this.jsform.mmx = this.jsform.mmx + this.jsform.ssx * 0.15;
					} else if (row = '三者') {
						this.jsform.mmx = this.jsform.mmx + this.jsform.dsx * 0.15;
					} else if (row = '司机') {
						this.jsform.mmx = this.jsform.mmx + this.jsform.csdx * 0.15;
					} else if (row = '乘客') {
						this.jsform.mmx = this.jsform.mmx + this.jsform.csrx * 0.15;
					} else if (row = '盗抢') {
						this.jsform.mmx = this.jsform.mmx + this.jsform.dqx * 0.2;
					} else if (row = '划痕') {
						this.jsform.mmx = this.jsform.mmx + this.jsform.hhx * 0.15;
					}
				});
			},
			exit() {
				sessionStorage.clear();
				this.$router.push("/login");
			},
			zhProspectState(caseHandling) {
				if (caseHandling == 1) {
					return "保险期内";
				} else if (caseHandling == 2) {
					return "注销";
				} else {
					return "退保";
				}
			},
			zhDisposeType(caseState) {
				if (caseState == 1) {
					return "新保";
				} else {
					return "续保";
				}
			},
			qinkon: function() {
				this.form = {
					//保单编号，例如 bd_2019010100001
					warrantyId: '',
					//投保人-外键
					policyholdersId: 0,
					//被保人-外键
					recognizeeId: 0,
					//签单日期
					permissionTime: '',
					//保险起期
					insuranceBeginTime: '',
					//保险止期
					insuranceEndTime: '',
					//缴费时间
					paymentTime: '',
					//保费总额
					premiumTotal: 0,
					//保单类型(1.新保 2.续保)
					warrantyType: 1,
					//保单状态(1.正常 2.注销 3.退保)
					warrantyState: 1,
					//投保金额
					insureMoney: 0,
					//保险金额
					premiumMoney: 0,
					//赔偿限额
					indemnifyMax: 0,
					//发动机号
					engineid: '',
					//车架号
					frameId: '',
					//厂牌型号
					makeId: '',
					//车身颜色
					licenseId: '',
					//使用性质
					nature: '',
					//出厂日期
					mintedDate: '',
					//核定载客数
					customersSum: '',
					//车辆行驶证号
					sailNumber: '',
					//车主姓名
					carOwnerName: '',
					//新车购置价
					vpDollar: 0,
					//初次登记日期
					registerDate: '',
					//际使用年限
					placemanLength: 0,
					//已行驶里程
					mileage: 0,
					//车牌号
					plateNumber: '',
					//结案时间
					closeCaseTime: '',
					//案件状态
					caseState: 1,
					//被保人
					recognizeeName: ''
				}
			},
			policyAll: function() {
				this.gqcount=0;
				var date1=new Date().getTime();
				this.$axios.get("warranty/getWarrantyAll?page=" + this.page)
					.then(msg => {
						this.total = msg.data.total;
						this.tableData = msg.data.list;
						this.tableData.forEach((row,i) =>{
							var date2=new Date(row.insuranceEndTime).getTime();
							if(date2<date1){
								this.$axios.get("warranty/updWarrantyState?warrantyState=2&warrantyId=" + row.warrantyId)
									.then(msg => {											
									})
							}
							var diffDate = (date1-date2) / (24 * 60 * 60 * 1000);
							if(diffDate<=30){
								this.gqcount++;
							}
							
						})
						this.policyAll2();
					});
			},
			policyAll2:function(){
				this.$axios.get("warranty/getWarrantyAll?page=" + this.page)
					.then(msg => {
						this.total = msg.data.total;
						this.tableData = msg.data.list;
					});
			},
			del: function() {
				if (this.currentRow != null) {
					this.$confirm('此操作将删除保单号为' + this.currentRow.warrantyId + '记录, 是否继续?', '提示', {
						confirmButtonText: '确定',
						cancelButtonText: '取消',
						type: 'warning'
					}).then(() => {
						this.$axios.get("warranty/updWarrantyState?warrantyState=3&warrantyId=" + this.currentRow.warrantyId)
							.then(msg => {
								if (msg.data > 0) {
									this.$notify({
										type: 'success',
										message: '状态成功改为退保!'
									});
									this.policyAll();
								}
							})
					}).catch(() => {

						this.$notify({
							title: '取消删除',
							type: 'info'
						});
					});
				} else {
					this.$notify({
						title: '请选择需要删除的保单信息',
						type: 'warning'
					});
				}
			},
			formfuz: function() {
				this.form = {
					//保单编号，例如 bd_2019010100001
					warrantyId: this.currentRow.warrantyId,
					//投保人-外键
					policyholdersId: this.currentRow.policyholdersId,
					//被保人-外键
					recognizeeId: this.currentRow.recognizeeId,
					//签单日期
					permissionTime: this.currentRow.permissionTime,
					//保险起期
					insuranceBeginTime: this.currentRow.insuranceBeginTime,
					//保险止期
					insuranceEndTime: this.currentRow.insuranceEndTime,
					//缴费时间
					paymentTime: this.currentRow.paymentTime,
					//保费总额
					premiumTotal: this.currentRow.premiumTotal,
					//保单类型(1.新保 2.续保)
					warrantyType: this.currentRow.warrantyType,
					//保单状态(1.正常 2.注销 3.退保)
					warrantyState: this.currentRow.warrantyState,
					//投保金额
					insureMoney: this.currentRow.insureMoney,
					//保险限额
					premiumMoney: this.currentRow.premiumMoney,
					//赔偿限额
					indemnifyMax: this.currentRow.indemnifyMax,
					//发动机号
					engineid: this.currentRow.engineid,
					//车架号
					frameId: this.currentRow.frameId,
					//厂牌型号
					makeId: this.currentRow.makeId,
					//车身颜色
					licenseId: this.currentRow.licenseId,
					//使用性质
					nature: this.currentRow.nature,
					//出厂日期
					mintedDate: this.currentRow.mintedDate,
					//核定载客数
					customersSum: this.currentRow.customersSum,
					//车辆行驶证号
					sailNumber: this.currentRow.sailNumber,
					//车主姓名
					carOwnerName: this.currentRow.carOwnerName,
					//新车购置价
					vpDollar: this.currentRow.vpDollar,
					//初次登记日期
					registerDate: this.currentRow.registerDate,
					//际使用年限
					placemanLength: this.currentRow.placemanLength,
					//已行驶里程
					mileage: this.currentRow.mileage,
					//车牌号
					plateNumber: this.currentRow.plateNumber,
					//结案时间
					closeCaseTime: this.currentRow.closeCaseTime,
					//案件状态
					caseState: this.currentRow.caseState,
					//被保人
					recognizeeName: this.currentRow.recognizeeName
				}
			},
			openShenhe: function() {
				if (this.currentRow != null) {
					this.formfuz();
					this.$axios.get("recognizee/getRecognizeePid?policyholdersId=" + this.currentRow.policyholdersId)
						.then(msg => {
							this.relist = msg.data;
						})
					this.dialogFormVisible2 = true;

				} else {
					this.$notify({
						title: '请选择需要审核的保单信息',
						type: 'warning'
					});
				}
			},
			shenhe: function() {
				this.$axios.get("warranty/updWarrantyState?warrantyState=" + this.form.warrantyState + "&warrantyId=" + this.form.warrantyId)
					.then(msg => {
						if (msg.data > 0) {
							this.$notify({
								type: 'success',
								message: '审核成功!'
							});
							this.dialogFormVisible2 = false;
							this.policyAll();
						}
					})
			},
			openinsert: function() {
				this.qinkon();
				this.dialogFormVisible1 = true;
				this.flag1 = false;
				this.flag2 = false;
			},
			jsform1() {
				if (this.form.customersSum < 6) {
					this.dsanz1();
				} else {
					this.dsanz2();
				}
			},
			jsform2() {
				if (this.form.customersSum < 6) {
					this.jsform.csdx = this.jsform.qianx2 * 42;
				} else {
					this.jsform.csdx = this.jsform.qianx2 * 40;
				}
			},
			jsform3() {
				if (this.form.customersSum < 6) {
					this.jsform.csrx = this.jsform.qianx3 * 27 * this.form.customersSum;
				} else {
					this.jsform.csrx = this.jsform.qianx3 * 26 * this.form.customersSum;
				}
			},
			jsform4() {
				if (this.form.customersSum < 6) {
					this.jsbl();
				} else {
					this.jsb2();
				}

			},
			jsform5() {
				this.jshh();
			},
			dsanz1: function() {
				if (this.jsform.qianx == 10) {
					this.jsform.dsx = 1099;
				} else if (this.jsform.qianx == 20) {
					this.jsform.dsx = 1335;
				} else if (this.jsform.qianx == 30) {
					this.jsform.dsx = 1492;
				} else if (this.jsform.qianx == 50) {
					this.jsform.dsx = 1772;
				} else if (this.jsform.qianx == 100) {
					this.jsform.dsx = 2308;
				}
			},
			dsanz2: function() {
				if (this.jsform.qianx == 10) {
					this.jsform.dsx = 941;
				} else if (this.jsform.qianx == 20) {
					this.jsform.dsx = 1142;
				} else if (this.jsform.qianx == 30) {
					this.jsform.dsx = 1277;
				} else if (this.jsform.qianx == 50) {
					this.jsform.dsx = 1517;
				} else if (this.jsform.qianx == 100) {
					this.jsform.dsx = 1976;
				}
			},
			jsbl: function() {
				if (this.jsform.qian4 == '国产玻璃') {
					this.jsform.blx = this.form.vpDollar * 0.0019;
				} else {
					this.jsform.blx = this.form.vpDollar * 0.0031;
				}
			},
			jsbl2: function() {
				if (this.jsform.qian4 == '进口玻璃') {
					this.jsform.blx = this.form.vpDollar * 0.0019;
				} else {
					this.jsform.blx = this.form.vpDollar * 0.0030;
				}
			},
			jshh: function() {

				if (this.form.vpDollar < 300000) {
					//车使用年限
					if (this.form.placemanLength < 2) {
						if (this.jsform.qian5 == 2000) {
							this.jsform.hhx = 400;
						} else if (this.jsform.qian5 == 5000) {

							this.jsform.hhx = 570;

						} else if (this.jsform.qian5 == 10000) {
							this.jsform.hhx = 760;
						} else if (this.jsform.qian5 == 20000) {
							this.jsform.hhx = 1140;
						}
					} else {
						if (this.jsform.qian5 == 2000) {
							this.jsform.hhx = 610;
						} else if (this.jsform.qian5 == 5000) {
							this.jsform.hhx = 850;
						} else if (this.jsform.qian5 == 10000) {
							this.jsform.hhx = 1300;
						} else if (this.jsform.qian5 == 20000) {
							this.jsform.hhx = 1900;
						}
					}
				} else if (this.form.vpDollar >= 300000 && this.form.vpDollar <= 500000) {
					if (this.form.placemanLength < 2) {
						if (this.jsform.qian5 == 2000) {
							this.jsform.hhx = 585;
						} else if (this.jsform.qian5 == 5000) {
							this.jsform.hhx = 900;
						} else if (this.jsform.qian5 == 10000) {
							this.jsform.hhx = 1170;
						} else if (this.jsform.qian5 == 20000) {
							this.jsform.hhx = 1780;
						}
					} else {
						if (this.jsform.qian5 == 2000) {
							this.jsform.hhx = 900;
						} else if (this.jsform.qian5 == 5000) {
							this.jsform.hhx = 1350;
						} else if (this.jsform.qian5 == 10000) {
							this.jsform.hhx = 1800;
						} else if (this.jsform.qian5 == 20000) {
							this.jsform.hhx = 2600;
						}
					}
				} else {
					if (this.form.placemanLength < 2) {
						if (this.jsform.qian5 == 2000) {
							this.jsform.hhx = 850;
						} else if (this.jsform.qian5 == 5000) {
							this.jsform.hhx = 1100;
						} else if (this.jsform.qian5 == 10000) {
							this.jsform.hhx = 1500;
						} else if (this.jsform.qian5 == 20000) {
							this.jsform.hhx = 2250;
						}
					} else {
						if (this.jsform.qian5 == 2000) {
							this.jsform.hhx = 1100;
						} else if (this.jsform.qian5 == 5000) {
							this.jsform.hhx = 1500;
						} else if (this.jsform.qian5 == 10000) {
							this.jsform.hhx = 2000;
						} else if (this.jsform.qian5 == 20000) {
							this.jsform.hhx = 3000;
						}
					}
				}
			},
			js: function() {
				if (this.form.customersSum < 6) {
					this.jsform.jqx = 950;
					this.jsform.ssx = 630 + this.form.vpDollar * 0.015;
					this.dsanz1();
					this.jsform.csdx = this.jsform.qianx2 * 42;
					this.jsform.csrx = this.jsform.qianx3 * 27 * this.form.customersSum;
					this.jsform.dqx = 120 + this.form.premiumMoney * 0.0049;
					this.jsbl();
					this.jshh();
				} else {
					this.jsform.jqx = 1100;
					this.jsform.ssx = 756 + this.form.vpDollar * 0.015;
					this.dsanz2();
					this.jsform.csdx = this.jsform.qianx2 * 40;
					this.jsform.csrx = this.jsform.qianx3 * 26 * this.form.customersSum;
					this.jsform.dqx = 140 + this.form.premiumMoney * 0.0044
					this.jsbl2();
					this.jshh();
				}
			},
			js0:function(){
				if (this.form.customersSum < 6) {
					this.jsform.jqx = 950*0.8;
					this.jsform.ssx = 630 + this.form.vpDollar * 0.015*0.7;
					this.dsanz1();
					this.jsform.dsx=this.form.dsx*0.7;
					this.jsform.csdx = this.jsform.qianx2 * 42*0.7;
					this.jsform.csrx = this.jsform.qianx3 * 27 * this.form.customersSum*0.7;
					this.jsform.dqx = 120 + this.form.premiumMoney * 0.0049*0.7;
					this.jsbl();
					this.jsform.blx=this.jsform.blx*0.7;
					this.jshh();
					this.jsform.hhx=this.jsform.hhx*0.7
				} else {
					this.jsform.jqx = 1100*0.8;
					this.jsform.ssx = 756 + this.form.vpDollar * 0.015*0.7;
					this.dsanz2();
					this.form.dsx=this.form.dsx*0.7;
					this.jsform.csdx = this.jsform.qianx2 * 40*0.7;
					this.jsform.csrx = this.jsform.qianx3 * 26 * this.form.customersSum*0.7;
					this.jsform.dqx = 140 + this.form.premiumMoney * 0.0044*0.7;
					this.jsbl2();
					this.jsform.blx=this.jsform.blx*0.7;
					this.jshh();
					this.jsform.hhx=this.jsform.hhx*0.7
				}
			},
			js3:function(){
				if (this.form.customersSum < 6) {
					this.jsform.jqx = 950+95;
					this.jsform.ssx = 630 + this.form.vpDollar * 0.025;
					this.dsanz1();
					this.jsform.dsx=this.form.dsx+(this.form.dsx*0.1);
					this.jsform.csdx = this.jsform.qianx2 * 42+(this.jsform.qianx2 * 4.2);
					this.jsform.csrx = this.jsform.qianx3 * 27 * this.form.customersSum+(this.jsform.qianx3 * 2.7 * this.form.customersSum);
					this.jsform.dqx = 120 + this.form.premiumMoney * 0.0059;
					this.jsbl();
					this.jsform.blx=this.jsform.blx+(this.jsform.blx*0.1);
					this.jshh();
					this.jsform.hhx=this.jsform.hhx+(this.jsform.hhx*0.1);
				} else {
					this.jsform.jqx = 1100+110;
					this.jsform.ssx = 756 + this.form.vpDollar * 0.025;
					this.dsanz2();
					this.form.dsx=this.form.dsx+(this.form.dsx*0.1);
					this.jsform.csdx = this.jsform.qianx2 * 40+(this.jsform.qianx2 * 4);
					this.jsform.csrx = this.jsform.qianx3 * 26 * this.form.customersSum+(this.jsform.qianx3 * 2.6 * this.form.customersSum);
					this.jsform.dqx = 140 + this.form.premiumMoney * 0.0054;
					this.jsbl2();
					this.jsform.blx=this.jsform.blx+(this.jsform.blx*0.1);
					this.jshh();
					this.jsform.hhx=this.jsform.hhx+(this.jsform.hhx*0.1);
				}
			},
			js4:function(){
				if (this.form.customersSum < 6) {
					this.jsform.jqx = 950+190;
					this.jsform.ssx = 630 + this.form.vpDollar * 0.035;
					this.dsanz1();
					this.jsform.dsx=this.form.dsx+(this.form.dsx*0.2);
					this.jsform.csdx = this.jsform.qianx2 * 42+(this.jsform.qianx2 * 8.4);
					this.jsform.csrx = this.jsform.qianx3 * 27 * this.form.customersSum+(this.jsform.qianx3 * 5.4 * this.form.customersSum);
					this.jsform.dqx = 120 + this.form.premiumMoney * 0.0069;
					this.jsbl();
					this.jsform.blx=this.jsform.blx+(this.jsform.blx*0.2);
					this.jshh();
					this.jsform.hhx=this.jsform.hhx+(this.jsform.hhx*0.2);
				} else {
					this.jsform.jqx = 1100+220;
					this.jsform.ssx = 756 + this.form.vpDollar * 0.035;
					this.dsanz2();
					this.form.dsx=this.form.dsx+(this.form.dsx*0.2);
					this.jsform.csdx = this.jsform.qianx2 * 40+(this.jsform.qianx2 * 8);
					this.jsform.csrx = this.jsform.qianx3 * 26 * this.form.customersSum+(this.jsform.qianx3 * 5.2 * this.form.customersSum);
					this.jsform.dqx = 140 + this.form.premiumMoney * 0.0064;
					this.jsbl2();
					this.jsform.blx=this.jsform.blx+(this.jsform.blx*0.2);
					this.jshh();
					this.jsform.hhx=this.jsform.hhx+(this.jsform.hhx*0.2);
				}
			},
			js7:function(){
				if (this.form.customersSum < 6) {
					this.jsform.jqx = 950+285;
					this.jsform.ssx = 630 + this.form.vpDollar * 0.045;
					this.dsanz1();
					this.jsform.dsx=this.form.dsx+(this.form.dsx*0.3);
					this.jsform.csdx = this.jsform.qianx2 * 42+(this.jsform.qianx2 * 12.6);
					this.jsform.csrx = this.jsform.qianx3 * 27 * this.form.customersSum+(this.jsform.qianx3 * 8.1 * this.form.customersSum);
					this.jsform.dqx = 120 + this.form.premiumMoney * 0.0079;
					this.jsbl();
					this.jsform.blx=this.jsform.blx+(this.jsform.blx*0.3);
					this.jshh();
					this.jsform.hhx=this.jsform.hhx+(this.jsform.hhx*0.3);
				} else {
					this.jsform.jqx = 1100+330;
					this.jsform.ssx = 756 + this.form.vpDollar * 0.045;
					this.dsanz2();
					this.form.dsx=this.form.dsx+(this.form.dsx*0.3);
					this.jsform.csdx = this.jsform.qianx2 * 40+(this.jsform.qianx2 * 12);
					this.jsform.csrx = this.jsform.qianx3 * 26 * this.form.customersSum+(this.jsform.qianx3 * 7.8 * this.form.customersSum);
					this.jsform.dqx = 140 + this.form.premiumMoney * 0.0074;
					this.jsbl2();
					this.jsform.blx=this.jsform.blx+(this.jsform.blx*0.3);
					this.jshh();
					this.jsform.hhx=this.jsform.hhx+(this.jsform.hhx*0.3);
				}
			},
			jqpl:function(){
				if(this.form.warrantyType==1){
					this.js();
				}else{
					if(this.cxcount==0){
						this.js0();
					}else if(this.cxcount>0&&this.cxcount<=2){
						this.js();
					}else if(this.cxcount==3){
						this.js3();
					}else if(this.cxcount==4){
						this.js4();
					}else if(this.cxcount>=5&&this.cxcount<=7){
						this.js7();
					}
				}
			},
			next: function() {

				this.flag1 = false;
				this.flag2 = false;
				this.jqpl();
				this.dialogFormVisible1 = false;
				this.dialogTableVisible = true;
				this.xb.forEach((row, i) => {
					if (row == 1) {
						this.flag1 = true;
					}
					if (row == 2) {
						this.flag2 = true;
					}
				});
			},
			jssyx: function() {
				this.syje = 0;
				if (this.mmlist.length > 0) {
					this.xb.push(11);
				}
				var num = 0;
				var num2 = 0;
				this.xb.forEach((row, i) => {
					if (row == 1) {
						num++;
					}
					if (row == 2) {
						num2++;
					}
				});
				if (num == 0) {
					this.jsform.jqx = 0;
				}
				if (num2 == 0) {
					this.syje = 0;
				} else {
					this.xb.forEach((row, i) => {
						if (row == 3) {
							this.syje = this.syje + this.jsform.ssx;
						} else if (row == 4) {
							this.syje = this.syje + this.jsform.dsx;
						} else if (row == 5) {
							this.syje = this.syje + this.jsform.csdx;
						} else if (row == 6) {
							this.syje = this.syje + this.jsform.csrx;
						} else if (row == 7) {
							this.syje = this.syje + this.jsform.jqx;
						} else if (row == 8) {
							this.syje = this.syje + this.jsform.blx;
						} else if (row == 9) {
							this.syje = this.syje + this.jsform.hhx;
						} else if (row == 10) {
							this.syje = this.syje + this.jsform.zrx;
						} else if (row == 11) {
							this.syje = this.syje + this.jsform.mmx;
						}

					});
				}
			},
			addpolicy: function() {
				this.$axios.post("warranty/addWarranty", this.form)
					.then(msg => {
						if (msg.data > 0) {
							this.$axios.get("warranty/getWarrantyNow")
								.then(msg => {
									this.form.warrantyId = msg.data;
									this.xb.forEach((row, i) => {
										this.$axios.get("warranty/insertInsure?warrantyId=" + this.form.warrantyId + "&riskTypeId=" + row)
											.then(msg => {

											})
									});
								})

							this.dialogTableVisible = false;
							this.dialogTableVisible2 = true;
						}
					})
			},
			next2: function() {
				this.jssyx();
				this.addpolicy();
				this.sum = this.syje + this.jsform.jqx;

			},
			addTotal: function() {
				if (this.form.warrantyId != '' && this.form.warrantyId != null) {
					this.$axios.get("warranty/updatePremiumTotal?premiumTotal=" + this.sum + "&warrantyId=" + this.form.warrantyId)
						.then(msg => {
							if (msg.data > 0) {
								this.$notify({
									type: 'success',
									message: '报存成功!'
								});
								this.policyAll();
								this.dialogTableVisible2 = false;
							}
						})
				}
			},
			openUpdate: function() {
				if (this.currentRow != null) {

					this.formfuz();
					this.$axios.get("recognizee/getRecognizeePid?policyholdersId=" + this.currentRow.policyholdersId)
						.then(msg => {
							this.relist = msg.data;
						})
					this.dialogFormVisible3 = true;
				} else {
					this.$notify({
						title: '请选择需要修改的保单信息',
						type: 'warning'
					});
				}
			},
			xiugai: function() {
				this.$axios.post("warranty/updateWarranty", this.form)
					.then(msg => {
						if (msg.data > 0) {
							this.$notify({
								type: 'success',
								message: '修改成功!'
							});
							this.policyAll();
							this.dialogFormVisible3 = false;
						}
					})
			},
			openbaof: function() {
				if (this.currentRow != null) {
					this.xb = [];
					this.formfuz();
					this.$axios.get("warranty/selectRisk?warrantyId=" + this.currentRow.warrantyId)
						.then(msg => {
							this.xb = msg.data;
						})
					this.dialogTableVisible3 = true;
				} else {
					this.$notify({
						title: '请选择需要查看保费信息的保单记录',
						type: 'warning'
					});
				}
			}
		},
		mounted() {
			this.policyAll();
			this.$axios.get("recognizee/getRecognizeePid")
				.then(msg => {
					this.gridData = msg.data;
				})
			this.tjflag = true;
		}
	}
</script>

<style scoped>
	.el-header {
		text-align: center;
		line-height: 60px;
	}


	.el-container {
		margin-left: 8px;
	}

	.el-header {
		padding: 0 0;
		border: #A8A8A8 1px solid;
		border-bottom: 0px;
		background-color: white;
	}

	.el-main {
		background-color: white;
		border: #A8A8A8 1px solid;
	}

	.font1 {
		color: #545C64;
		font-size: 14.2px;
	}

	.form1 {
		display: flex;
		border: #A8A8A8 1px solid;
		padding-top: 20px;
	}


	.el-tabs {
		margin-top: 9px;
	}

	.button {
		margin-left: 41px;
	}

	.hover1:hover {
		color: blue;
	}

	.item1 {
		width: 900px;
	}

	.el-col-11 {
		width: 150px;
	}

	.el-col-2[data-v-57aef37c] {

		text-align: center;
	}

	.el-dialog {
		width: 60%;
	}

	.line {
		width: 60px;
	}

	.col1 {
		width: 800px;
	}

	.el-col-10 {
		width: 20%;
	}

	.el-form-item__content {
		text-align: center;
	}

	.el-button+.el-button {
		margin: 5px 0 0 0;
	}

	.el-button+.el-button[data-v-57aef37c] {
		margin: 5px 0 0 40px;
	}

	.el-button {
		margin: 0 0 0 40px;
	}

	.el-input {
		width: auto;
	}

	.el-input__inner {
		width: auto;
	}
</style>
